package com.bjbn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bjbn.bean.entity.FlightAirline;
import com.bjbn.mapper.secondary.FlightAirlineMapper;
import com.bjbn.service.FlightAirlineService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Slf4j
public class FlightAirlineServiceImpl  implements FlightAirlineService {

    @Autowired
    private FlightAirlineMapper flightAirlineMapper;

    @Override
    @Transactional(transactionManager = "secondaryTransactionManager")
    public List<FlightAirline> getFlightInfoByFlid(String flid) {
        QueryWrapper<FlightAirline> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("FLID", flid)
                .orderByAsc("APNO");
        return flightAirlineMapper.selectList(queryWrapper);
    }

}
